package com.learn.multDataSource.service.elastic.impl;

import com.learn.multDataSource.mapper.elastic.TRcenumMapper;
import com.learn.multDataSource.model.elastic.TRcenum;
import com.learn.multDataSource.service.elastic.EnumService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("enumService")
public class EnumServiceImpl implements EnumService {

    @Resource
    private TRcenumMapper tRcenumMapper;

    @Override
    @Transactional(readOnly = true)
    public TRcenum findById(String brokerid, String enumtypeid, String enumvalue) {
        TRcenum bank = tRcenumMapper.selectByPrimaryKey(brokerid, enumtypeid, enumvalue);
        System.out.println(bank);
        return bank;
    }

    @Override
    @Transactional()
    public void save(TRcenum tRcenum) {
        tRcenumMapper.insert(tRcenum);
    }
}
